//
//  UIView+IBExtension.swift
//  微博
//
//  Created by tong dan on 16/2/29.
//  Copyright © 2016年 tong dan. All rights reserved.
//

import UIKit

extension UIView{
    
    @IBInspectable var boarderWith:CGFloat{
        
        set{
            layer.borderWidth = newValue
        }
        
        get{
            return layer.borderWidth
            
        }
    }
    
    @IBInspectable var borderColor: UIColor?{
        
        set {
            layer.borderColor = newValue?.CGColor
            
        }
        
        get{
            
            if layer.borderColor != nil{
                return UIColor(CGColor: layer.borderColor!)
                
            }
            return nil
        }
    }
    
    @IBInspectable var cornerRadius:CGFloat {
        set {
            
            layer.cornerRadius = newValue
            layer.masksToBounds = newValue > 0
            
        }
        get{
            
            return layer.cornerRadius
        }
        
    }
}
